export const getQueryParam = (name, url) => {
  var reg = new RegExp("(^|\\?|&)" + name + "=([^&]*)(\\s|&|$)", "i"),
      Url = url || location.href;
  if (reg.test(Url))
    return decodeURI(RegExp.$2.replace(/\+/g, " "));
  return "";
};


export const someReg = {
  phone: /^1[3456789]\d{9}$/, //11位
  IdCard: /(\d{15}$)|(\d{18}$)|(^\d{17}(\d|X|x)$)/  //15-18位
};

export const getClient = () => {
  var ua = window.navigator.userAgent.toLowerCase()
  var sMobileSystem = '';
  if (/(iPhone|iPad|iPod|iOS)/i.test(ua)) {
    sMobileSystem = 'ios';
  } else if (/(Android)/i.test(ua)) {
    sMobileSystem = 'android';
  }

  return sMobileSystem;
}
